

/**
 * api接口统一管理
 */


import { get, post,postFormData} from './http'
export const login = p => post('user/login', p);//保存 post方法
 
/*
    中控
*/
//政府客户   企业客户
export const goverment_findByList = p => post('company/findByList', p); //列表
export const goverment_delete = p => get('company/delete/', p);//删除
export const goverment_save = p => postFormData('company/save', p);//新增
export const goverment_check = p => get('company/findById/', p);//查看
export const companyAppmenu = (id) => get('/company/load/appmenus/'+id)
export const companySetAppmenu = (params) => post('/company/set/appmenus',params)


// 模型库
export const model_findByList = p => post('/model/classify/findByList',p);
export const model_findByOne = p => post('/model/classify/findByOne',p)
export const model_findByTwo = p => get('/model/classify/findByTwo/',p)
export const model_save = p => postFormData('/model/classify/save',p)
export const model_findByParentId = p => get('/model/classify/findByParentId/',p)
export const model_cropsave = p => postFormData('/model/crop/save',p)
export const model_findByOneId = p => get('/model/crop/findByOneId/',p)
export const crop_findById = p => get('/model/crop/findById/',p)
export const model_findById = p => get("/model/classify/findById/",p)
export const momdel_delete = p =>get("/model/classify/delete/",p)
export const model_crop_delete = p => get("/model/crop/delete/",p)

export const model_crop_update = p => post("/model/crop/update",p)


// 产品管理

export const control_list = p => get('/control/app/list/',p)
export const app_used = (id,used) => get('/control/app/used/'+id+"/"+used)//更改app启用禁用状态
export const appMenus = (id) => get('/control/app/menus/'+id)
export const appAddResource = (params) => post('/control/app/add/resource',params)
export const appDeleResource = (id) => get('/control/app/dele/resource/'+id)
export const control_save = p => postFormData('/control/app/createcustomapp',p)//新增
export const control_lists = p => post("/control/app/list/customapp",p)
export const control_resourcesave = p => post("/resource/save",p)//权限新增
export const control_get = p => get("/resource/findByAppId/",p)//获取权限
export const control_createsave = p => post("/control/app/create/customappversion",p)
export const findCustomAppVersionId = p => get("/control/app/findCustomAppVersionId/",p)
export const customappversion = p => get("/control/app/list/customappversion/",p)

// 供应商管理
export const supplier_findByList = p => post('/supplier/findByList',p) //列表
export const supplier_delete = p => get('/supplier/delete/',p) //删除
export const supplier_save = p => post('/supplier/save',p) //新增
export const supplier_update = p => post('/supplier/update',p) //修改
export const supplier_findByAll = p => get('/supplier/findByAll',p) //下拉
export const supplier_findById = p => get('/supplier/findById/',p) //下拉
export const supplier_findByListLog = p => post('/supplier/findByListLog',p) //下拉


// 客户管理
export const client_findByList = p => post('/client/findByList',p)//列表
export const client_delete = p => get('/client/delete/',p)//删除
export const client_save = p => post('/client/save',p)//新增
export const client_update = p => post('/client/update',p)//修改
export const client_findById = p => get('/client/findById/',p)//详情页
export const client_findByAll = p => get("/client/findByAll/",p) // 客户下拉

// 检测依据
export const check_findByList = p => post("check/findByList",p)//列表
export const check_delete = p => get("check/delete/",p)//删除
export const check_update = p => post("check/update",p)//修改
export const check_findById = p => get("check/findById/",p)//详情
export const check_save = p => post("check/save",p)//新增
export const check_findByAll = p => get("check/findByAll",p)//下拉所有检测依据

// 设备管理
export const facility_findByList = p => post('/equipment/findByList',p)//列表
export const facility_delete = p => get('/equipment/delete/',p)//删除
export const facility_save = p => post('/equipment/save',p)//新增
export const facility_update = p => post('/equipment/update',p)//修改
export const facility_findById = p => get('/equipment/findById/',p)//查询
export const facility_findByAll = p => get('/equipment/findByAll',p)//下拉查询
export const equipment_findByType = p => post("equipment/findByType",p)//设备下拉  

// 分级标准
export const grade_findByList = p => post("grade/findByList",p)//列表
export const grade_delete = p => get("grade/delete/",p)//删除
export const grade_update = p => post("grade/update",p)//修改
export const grade_findById = p => get("grade/findById/",p)//详情
export const grade_save = p => post("grade/save",p)//新增


//单位管理
export const unit_findByList = p => get('unit/findByAll',p); //列表
export const unit_delete = p => get('unit/delete/', p);//删除
export const unit_save = p => post('unit/saves', p);//新增

// 工艺工序
export const technology_findByList = p => post("technology/findByList",p)//列表
export const technology_delete = p => get("technology/delete/",p)//删除
export const technology_update = p => post("technology/update",p)//修改
export const technology_findById = p => get("technology/findById/",p)//详情
export const technology_save = p => postFormData("technology/save",p)//新增
export const technology_findByAll = p => get("technology/findByAll",p)//新增

//检测管理
export const processDetail_findByList = p => post("processDetail/findByList",p)//加工检测列表
export const storageManage_findByList = p => post("storage/manage/findByList",p)//采购检测列表
export const processDetail_findById = p => get("processDetail/findById/",p)//加工检测
export const detection_save = p => post("detection/save",p)//新增检查
export const detection_findById = p => get("detection/findByRelevanceId/",p)//新增检查

// 员工管理
export const staff = p => post('department/save',p); 
export const staff_findById = p => get('department/findByCompanyId/',p); 
export const staff_getId = p => get('department/findByParentId/',p); 
export const staff_save = p => post('department/save',p); 
export const staff_update = p => post('department/update',p); 
export const staff_getfindById = p => get('department/findById/',p); 
export const staff_delete = p => get('department/delete/',p); 


//人员管理
export const user_findByAll = p => get("user/findByAll",p)//下拉所有人员
export const staffuser_save = p => postFormData('user/save',p);
export const staffuser_findByList = p => post('user/findByList',p); 
export const staffuser_delete = p => get('user/delete/',p); 
export const staffuser_update = p => postFormData('user/update',p); 
export const staffuser_findById = p => get('user/findById/',p);
export const staffuser_findByAll = p => get('department/findByAll',p);
export const staffuser_daoru = p => postFormData('user/excel',p);
export const staffuser_checkPwd = p => post("user/checkPassword",p);

// 企业信息
export const company_findById = p => get('company/findById/',p); //获取企业信息
export const company_update = p => postFormData('company/update',p)

// 基源管理
export const basesource_findByAll = p => get("/model/crop/findByCompany",p)
export const basesource_delete = p => get("/model/crop/company/delete/",p)
export const basesource_save = p => post("/model/crop/company/save",p)

// 仓储养护
export const curing_save = p => post("/storage/curing/save",p)
export const curing_findByList = p => post("/storage/curing/findByList",p)
export const curing_delete = p => get("/storage/curing/delete/",p)
export const curing_findById = p =>get("/storage/curing/findById/",p)
export const curing_update = p => post("/storage/curing/update",p)
export const curing_findByAll = p => get("/storage/curing/findByAll",p)

// 产品信息
export const products_save = p => post("/product/save",p)
export const products_findByList = p => post("/product/findByList",p)
export const products_delete = p => get("/product/delete/",p)
export const products_findByAll = p => get("/product/findByAll",p)
export const products_findById = p => get("/product/findById/",p)
// 基地管理
export const base_findByList = p => post('soil/findByList',p);
export const base_findById = p => post('soil/findById/',p);
export const base_delete = p => get('soil/delete/',p);
export const base_findByAll = p => get('soil/findAllBase',p)
export const plot_findByAll = p => post('soil/findSoilByType',p)

// 投入品管理
export const inputs_save = p => post('inputs/save', p);//新增       
export const inputs_findByList = p => post('inputs/findByList', p);//列表
export const inputs_findById = p => get('inputs/findById/', p);//查看详情

// 种植管理
export const plant_save = p => post('plant/save', p);//新增       
export const plant_findByList = p => post('plant/findByList', p);//列表
export const plant_findById = p => get('plant/findById/', p);//查看详情
// export const plant_push = p => post("/plant/push",p)
// export const farm_findByUserId = p =>get("/farm/findByUserId/",p)
// 采收管理
export const revovery_part = p => get("/model/crop/findByModelId/",p)//获取部位
export const reap_save = p => postFormData("/reap/save",p)//新增采收
export const reap_findByList = p => post("/reap/findByList",p)//采收列表
export const reap_findById = p => get("/reap/findById/",p) //

// 仓储管理

export const storage_save = p => post("/storage/manage/save",p)// 新增入库
export const storage_findByList = p => post("/storage/manage/findByList",p)// 列表
export const storage_adjustment = p => post("/storage/manage/adjustment",p)//调整库存
export const storage_findById = p => get("/storage/manage/findById/",p)//明细
export const storage_curing_save = p => postFormData("/storage/manage/curing/save",p)//养护
export const storage_outByStorage = p => get("/storage/manage/outByStorageId/",p) //待入库 出库信息
export const storage_out = p => post("/storage/manage/out",p) // 出库物流

// 田间管理
export const farm_save = p => postFormData("farm/save",p)
export const farm_push = p => post("/farm/push",p)
export const farm_findByUserId = p =>get("/farm/findByUserId/",p)

// 加工管理

export const reapdetail_findByList = p => post("reapDetail/findByList",p)  //加工 原料下拉
export const reapDetail_findAllBreed = p => get("reapDetail/findAllBreed",p)   //选择加工原料时 品名的下拉

export const process_save = p => postFormData("process/save",p)
export const process_findByList = p => post("processDetail/findByList",p)
export const process_findById = p => get("/process/findById/",p)//根据id 查询加工详情

// 分包管理

export const sub_findByList = p => post("sub/findByList",p) //分包列表
export const sub_save = p => post("sub/save",p) // 点击分包
export const sub_findByRelevanceId = p =>get("sub/findByRelevanceId/",p) //分包查看列表


// 订单管理

export const order_save = p => post("order/save",p)//新增订单
export const order_findByList = p => post("order/findByList",p)// 订单列表
export const order_delete = p => get("order/delete/",p)//删除
export const order_update = p => post("order/update/",p)//修改
export const order_findById = p => get("order/findById/",p)// 根据id 查询详情


// 赋码管理

export const sub_findPrintMsg = p => get("sub/findPrintMsg/",p)
export const sub_offLinePrint = p => post("sub/offLinePrint",p) // 离线下载
// export const sub_findByList = p => post("sub/findByList",p)//赋码管理 列表sub/findByList

export const get_code = p => post("sub/getCode",p)
